##
## @file Makefile
## Verteilte Cpmputer Systeme TCP Uebung Makefile
##
## @author Robert Grasböck <rober.grasboeck@technikum-wien.at>
## @author David Schreiber <david.schreiber@technikum-wien.at>
## @date 2010/12/07
##
## @version $Revision: 1.0 $
##
## URL: $HeadURL$
##

##
## ------------------------------------------------------------- variables --
##

TARGET1 = simple_message_client_1186
TARGET2 = simple_message_server_1186

VERSION = 0.1
CC = gcc
CFLAGS =-DDEBUG -g -Wall -pedantic -Werror -Wextra -DVERSION=\"$(VERSION)\"
LDFLAGS = -Wl,-rpath,/usr/local/lib
LIBS =
CD = cd
MV = mv
GREP = grep
DOXYGEN = doxygen

EXCLUDE_PATTERN = footrulewidth

##
## ----------------------------------------------------------------- rules --
##

%.o : %.c
		$(CC) $(CFLAGS) -c $<

##
## --------------------------------------------------------------- targets --
##

all: $(TARGET1) $(TARGET2)

$(TARGET1): simple_message_client_1186.c
	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^

$(TARGET2): simple_messsage_server_1186.c
	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^

clean:
	$(RM) *.o *~ $(TARGET1) $(TARGET2)

distclean: clean
	$(RM) -r doc

doc: html pdf

html:
	$(DOXYGEN) doxygen.dcf

pdf: html
	$(CD) doc/pdf && \
	$(MV) refman.tex refman_save.tex && \
	$(GREP) -v $(EXCLUDE_PATTERN) refman_save.tex > refman.tex && \
	$(RM) refman_save.tex && \
	make && \
	$(MV) refman.pdf refman.save && \
	$(RM) *.pdf *.html *.tex *.aux *.sty *.log *.eps *.out *.ind *.idx \
	      *.ilg *.toc *.tps Makefile && \
	$(MV) refman.save refman.pdf

##
## ---------------------------------------------------------- dependencies --
##

##
## =================================================================== eof ==
##